<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<script>
    function Hash(){
        this.table=new Array(137);
    }
    Hash.prototype={
        simpleHash: function (str) {
            const H=37;
            var total= 0,size=str.length;
            while(size--){
                total+=H*total+str.charCodeAt(size);
            }
            return total % this.table.length;
        },
        show: function () {
            console.info('show data:');
            console.log(this.table);
        },
        put: function (key,data) {
            var pos=this.simpleHash(key);
            this.table[pos]=data;
        },
        get: function (key) {
            return this.table[this.simpleHash(key)];
        }
    }

    var hash=new Hash();
    var size= 3,name,score,list=[];
    while(size--){
        name=window.prompt('Name:');
        score=window.prompt('Score:');
        list.push({'name':name,score:score});
    }
    console.log(list);




</script>
</body>
</html>